-
-
Notifications
You must be signed in to change notification settings - Fork 670
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add thousands separators to amounts #2425
Conversation
All amounts, or all amounts that are represented as |
all amounts. is there a requirement to not do this for non-sats? |
Looking at the big negative diff - looks like all the |
this is a problem because it seems to be used internally in NEM code. it is weird that the NEM device tests did not crash on that though. |
Originally yes. Clarified with @hynek-jina that Suite will thousand separate all cryptocurrencies. So please disregard my previous comment. |
fixed in 3d7ea3f |
because of the NEM thing I had to change |
I am wondering whether I didn't check the size of the allocated buffers thoroughly, because I assume that the device tests would be likely to uncover any problems especially if we check the UI test screens thoroughly. |
LGTM after fixes, you just missed one fixture https://satoshilabs.gitlab.io/-/trezor/trezor-firmware/-/jobs/2797235219/artifacts/test_ui_report/failed/TT_zcash-test_sign_tx.py::test_spend_v5_input.html |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approve for the python part
Don't forget to change the fixture for https://satoshilabs.gitlab.io/-/trezor/trezor-firmware/-/jobs/2797235219/artifacts/test_ui_report/failed/TT_zcash-test_sign_tx.py::test_spend_v5_input.html , otherwise approve |
3d7ea3f
to
31f608e
Compare
31f608e
to
b06f5b0
Compare
it does, but OTOH it's a correct rendering of numbers so 🤷♀️ |
fixes #2394
on trezor-core side, the thousands separators are only added to amounts, or more generally, anything formatted with
format_amount
. There are several more places where large integers are displayed which are not amounts. These are mostly out of scope however.On legacy, there is no special "format_amount", so the general
bn_format
function is modified. I considered adding a parameter to specify whether the caller wants thousands separators or not, but decided against it in the end, as it would require changes in a lot of places and using thousands separators everywhere seems desirable anyway.